<?php

namespace JLPay\Models\Ledger\BalanceSplit;

use JLPay\Models\BaseRequest;

/**
 * 余额分账请求
 */
class BalanceSplitRequest extends BaseRequest
{
    /**
     * API URL
     */
    public const API_URL = '/open/ledger/balance/split';

    protected ?string $orgCode = null;
    protected ?string $mchId = null;
    protected ?string $outOrderNo = null;
    protected ?string $totalAmount = null;
    protected ?array $receivers = null;

    /**
     * 设置机构代码
     *
     * @param string $orgCode
     * @return self
     */
    public function setOrgCode(string $orgCode): self
    {
        $this->orgCode = $orgCode;
        return $this;
    }

    /**
     * 设置商户号
     *
     * @param string $mchId
     * @return self
     */
    public function setMchId(string $mchId): self
    {
        $this->mchId = $mchId;
        return $this;
    }

    /**
     * 设置外部订单号
     *
     * @param string $outOrderNo
     * @return self
     */
    public function setOutOrderNo(string $outOrderNo): self
    {
        $this->outOrderNo = $outOrderNo;
        return $this;
    }

    /**
     * 设置分账总金额
     *
     * @param string $totalAmount
     * @return self
     */
    public function setTotalAmount(string $totalAmount): self
    {
        $this->totalAmount = $totalAmount;
        return $this;
    }

    /**
     * 设置分账接收方列表
     *
     * @param array $receivers
     * @return self
     */
    public function setReceivers(array $receivers): self
    {
        $this->receivers = $receivers;
        return $this;
    }

    /**
     * 获取机构代码
     *
     * @return string|null
     */
    public function getOrgCode(): ?string
    {
        return $this->orgCode;
    }

    /**
     * 获取商户号
     *
     * @return string|null
     */
    public function getMchId(): ?string
    {
        return $this->mchId;
    }

    /**
     * 获取外部订单号
     *
     * @return string|null
     */
    public function getOutOrderNo(): ?string
    {
        return $this->outOrderNo;
    }

    /**
     * 获取分账总金额
     *
     * @return string|null
     */
    public function getTotalAmount(): ?string
    {
        return $this->totalAmount;
    }

    /**
     * 获取分账接收方列表
     *
     * @return array|null
     */
    public function getReceivers(): ?array
    {
        return $this->receivers;
    }
} 